1. Technical Field
This invention generally relates to computer systems, and more specifically relates to apparatus and methods for accessing data in a computer database.
2. Background Art
Since the dawn of the computer age, computers have evolved and become more and more powerful. In our present day, computers have become indispensable in many fields of human endeavor including engineering design, machine and process control, information storage and retrieval, and office computing. One of the primary uses of computers is for information storage and retrieval.
Database systems have been developed that allow a computer to store a large amount of information in a way that allows a user to search for and retrieve specific information in the database. For example, an insurance company may have a database that includes all of its policy holders and their current account information, including payment history, premium amount, policy number, policy type, exclusions to coverage, etc. A database system allows the insurance company to retrieve the account information for a single policy holder among the thousands and perhaps millions of policy holders in its database.
Retrieval of information from a database is typically done using queries. A query usually specifies conditions that apply to one or more columns of the database, and may specify relatively complex logical operations on multiple columns. The database is searched for records that satisfy the query, and those records are returned as the query result, which is also known as a “result set”.
Some queries take a relatively long time to process. In many computer systems, long queries are common and thus are frequently processed. In the prior art, each query is typically processed individually as it is received. Some prior art database systems recognize that the result set from one query may satisfy a subsequent query, so the result set that satisfies the query is cached for future use. When a subsequent query needs the same data, it can pull the data out of the result set in the cache rather than performing the lengthy query by interrogating the database. The problem with this approach is that the data in the cache may be stale, which means the underlying data in the database may have changed. If this happens, delivering the cached result set will result in stale data being delivered to the subsequent query. In some environments, data staleness may not be an issue. This may be due to infrequent updates that mean cached data is almost always accurate, or because the overhead of keeping the cached data current is more than the impact of using stale data. However, in many applications that rely on accurate real-time data, such as airline reservation systems, returning stale data is not acceptable. Thus, to assure the data is fresh, caching of query results is disabled, and each query must be individually processed by interrogating the database for each query. This individual processing of the same or similar queries is inefficient and reduces system performance. Without a way to process multiple queries in a way that assures the data is current for all the queries and in a way that eliminates the processing time for one or more queries, the computer industry will continue to suffer performance penalties when executing database queries.